

<%@ page import="edu.auctionmart.Auction" %>
<!doctype html>
<html>
    <head>
        <meta name="layout" content="mobile">
        <g:set var="entityName" value="${message(code: 'auction.label', default: 'Auction')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
		<div data-role="header" data-position="fixed">
			<h1><g:message code="default.edit.label" args="[entityName]" /></h1>
			<div data-role="navbar">
				<ul>
					<li><a data-icon="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
					<li><g:link data-icon="grid" data-ajax="false" action="listMobile"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
				</ul>
			</div>
		</div>
		<div data-role="content">
			<g:if test="${flash.message}">
			<div class="message" role="alert">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${auctionInstance}">
			<div class="errors" role="alert">
				<g:renderErrors bean="${auctionInstance}" as="list" />
			</div>
			</g:hasErrors>
			<g:form method="post" >
				<g:hiddenField name="id" value="${auctionInstance?.id}" />
				<g:hiddenField name="version" value="${auctionInstance?.version}" />
			
				<div data-role="fieldcontain">
					<label for="winner"><g:message code="auction.winner.label" default="Winner" /></label>
					<g:select name="winner.id" from="${edu.auctionmart.User.list()}" optionKey="id" value="${auctionInstance?.winner?.id}" noSelection="['null': '']" />
				</div>
			
				<div data-role="fieldcontain">
					<label for="seller"><g:message code="auction.seller.label" default="Seller" /></label>
					<g:select name="seller.id" from="${edu.auctionmart.User.list()}" optionKey="id" value="${auctionInstance?.seller?.id}"  />
				</div>
			
				<div data-role="fieldcontain">
					<label for="item"><g:message code="auction.item.label" default="Item" /></label>
					<g:select name="item.id" from="${edu.auctionmart.Item.list()}" optionKey="id" value="${auctionInstance?.item?.id}"  />
				</div>
			
				<div data-role="fieldcontain">
					<label for="bids"><g:message code="auction.bids.label" default="Bids" /></label>
					
<ul>
<g:each in="${auctionInstance?.bids?}" var="b">
    <li><g:link controller="bid" action="show" id="${b.id}">${b?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="bid" action="create" params="['auction.id': auctionInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'bid.label', default: 'Bid')])}</g:link>

				</div>
			
				<div data-role="fieldcontain">
					<label for="auctionTitle"><g:message code="auction.auctionTitle.label" default="Auction Title" /></label>
					<g:textField name="auctionTitle" value="${auctionInstance?.auctionTitle}" />
				</div>
			
				<div data-role="fieldcontain">
					<label for="startTime"><g:message code="auction.startTime.label" default="Start Time" /></label>
					
				</div>
			
				<div data-role="fieldcontain">
					<label for="endTime"><g:message code="auction.endTime.label" default="End Time" /></label>
					
				</div>
			
				<div data-role="fieldcontain">
					<label for="startBid"><g:message code="auction.startBid.label" default="Start Bid" /></label>
					<g:field type="number" name="startBid" value="${fieldValue(bean: auctionInstance, field: 'startBid')}" />
				</div>
			
				<div data-role="fieldcontain">
					<label for="hiddenMinBid"><g:message code="auction.hiddenMinBid.label" default="Hidden Min Bid" /></label>
					<g:field type="number" name="hiddenMinBid" value="${fieldValue(bean: auctionInstance, field: 'hiddenMinBid')}" />
				</div>
			
				<div data-role="fieldcontain">
					<label for="currentBid"><g:message code="auction.currentBid.label" default="Current Bid" /></label>
					<g:select name="currentBid.id" from="${edu.auctionmart.Bid.list()}" optionKey="id" value="${auctionInstance?.currentBid?.id}" noSelection="['null': '']" />
				</div>
			
				<div data-role="fieldcontain">
					<label for="formattedStartTime"><g:message code="auction.formattedStartTime.label" default="Formatted Start Time" /></label>
					<g:textField name="formattedStartTime" value="${auctionInstance?.formattedStartTime}" />
				</div>
			
				<div data-role="fieldcontain">
					<label for="formattedEndTime"><g:message code="auction.formattedEndTime.label" default="Formatted End Time" /></label>
					<g:textField name="formattedEndTime" value="${auctionInstance?.formattedEndTime}" />
				</div>
			
				<div data-role="fieldcontain">
					<label for="status"><g:message code="auction.status.label" default="Status" /></label>
					<g:select name="status" from="${edu.auctionmart.AuctionStatus?.values()}" keys="${edu.auctionmart.AuctionStatus?.values()*.name()}" value="${auctionInstance?.status?.name()}"  />
				</div>
			
				<g:actionSubmit data-icon="check" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
			</g:form>
		</div>
		<div data-role="footer">
		</div>
    </body>
</html>
